import { functionCommon, requestCommon } from "@whzhuke/common"

export default {
  tree: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/tree`,
      params
    })
  },//获取目录树
  create: (params: any) => {
    return requestCommon.postJson<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/`,
      params
    })
  },//新建目录
  edit: (params: any) => {
    return requestCommon.put<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/`,
      params
    })
  },//修改目录
  del: (params: any) => {
    return requestCommon.del<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/${params.id}`,
      params
    })
  },//删除目录
  path: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/${params.id}/path`,
      params
    })
  },//获取目录路径
  list: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/`,
      params
    })
  },//获取目录分页列表
  item: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/${params.id}`
    })
  },//获取目录详情
  upload: (params: any) => {
    return requestCommon.post<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/upload/file`,
      params
    })
  },//上传文件
  move: (params: any) => {
    return requestCommon.put<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/sys/folder/move/object`,
      params
    })
  },//移动目录文件或子目录

}
